function Util(){
}

var util = new Util();

Util.prototype.storage = {
    init: function(){
        try {
            return 'localStorage' in window && window['localStorage'] !== null;
        } catch (e) {
            return false;
        }
    },
    get: function(key){
        if (this.init()) {
            return localStorage.getItem(key);
        }
    },
    set: function(key, value){
        if (this.init()) {
            localStorage.setItem(key, value);
        }
    }
}

var storage = util.storage;
